var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__objRest=(e,t)=>{var r={};for(var n in e)__hasOwnProp.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&__getOwnPropSymbols)for(var n of __getOwnPropSymbols(e))t.indexOf(n)<0&&__propIsEnum.call(e,n)&&(r[n]=e[n]);return r},__async=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{l(r.next(e))}catch(t){i(t)}},a=e=>{try{l(r.throw(e))}catch(t){i(t)}},l=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,a);l((r=r.apply(e,t)).next())}));!function(){"use strict";const e=(e,t=["userway"])=>{const r=__spreadProps(__spreadValues({},e),{isUserWay:!0});t.forEach((e=>{let t=window.frames[e];if(!t||"function"!=typeof t.postMessage)try{t=document.querySelector(`iframe[name=${e}]`),t=t?t.contentWindow:null}catch(n){console.error(n)}t&&t.postMessage(r,"*")}))},t=(e,t)=>{if(e===document)return!0;const r=e,n=getComputedStyle(r),i=r.getBoundingClientRect(),o=(e=>e.top>=0&&e.left>=0&&e.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&e.right<=(window.innerWidth||document.documentElement.clientWidth))(i),a=0===i.width||0===i.height,l="0"!==n.opacity&&"hidden"!==n.visibility&&"none"!==n.display&&"collapse"!==n.visibility;return(r.offsetWidth>0||r.offsetHeight>0||r.getClientRects().length>0)&&(!t.shouldBeInViewport||o)&&!a&&l},r=e=>e.nodeType===Node.ELEMENT_NODE,n=e=>{if(!r(e))return!1;const t=e.getAttribute("aria-hidden"),n=e.getAttribute("hidden");return(e=>!!r(e)&&"none"===window.getComputedStyle(e).display)(e)||"true"===t||null!==n&&""!==n},i=e=>{if(!r(e))return!1;const t=e.getAttribute("aria-hidden"),n=e.getAttribute("hidden");return"true"===t||null!==n&&""!==n||void 0},o=["NOSCRIPT","SCRIPT","style"],a=(e,t,r={includeTextFromVisuallyHiddenElements:!1})=>{var l;const{includeTextFromVisuallyHiddenElements:s}=r;for(let u=0;u{let n=t;return(t=a(e.childNodes,n,r)).replace(/\s+/g," ").trim()},s=e=>{let t=e.split(" "),r="";for(let n=0;n{var r,n,i;let o=null!=(n=null==(r=e.getAttribute("aria-label"))?void 0:r.trim())?n:"";const a=!(null==(i=null==t?void 0:t.excludeAttribute)?void 0:i.includes("aria-describedby"))&&e.getAttribute("aria-describedby");if(o+=a?d(a):"",o)return o.toLowerCase();const s=e.getAttribute("aria-labelledby");if(s&&(o+=d(s)),o.trim())return o.toLowerCase();if(o=l(e),o.trim())return o.toLowerCase();if("INPUT"===e.tagName){const t=e;if(o=t.value||"",o.trim()&&t.type&&["button","submit","reset"].includes(t.type.toLowerCase()))return o.toLowerCase()}if(!e.hasChildNodes())return null;let u=e.querySelector('img, *[role="img"]');return u&&(o=c(u)||"",o.trim())?o.toLowerCase():null},c=e=>{const t=e.alt;if(t&&t.trim())return t.trim();const r=e.getAttribute("aria-label");if(r&&r.trim())return r.trim();const n=e.getAttribute("aria-describedby");if(n){const e=d(n);if(e)return e}const i=e.getAttribute("aria-labelledby");if(i){let e=d(i);if(e)return e}return null},d=e=>e.split(" ").reduce(((e,t)=>{const r=document.getElementById(t.trim());if(!r)return e;if((e=>["noscript","style","img","script","br","hr"].includes(e.tagName.toLowerCase()))(r))return e;const n=l(r);return n?e+" "+n:e}),"").trim(),p=()=>"uw"+(~~(1e8*Math.random())).toString(16),m=(e,t=0)=>{let r=3735928559^t,n=1103547991^t;for(let i,o=0;o>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),4294967296*(2097151&n)+(r>>>0)},f=(e,t=!1)=>{var r;if("html"===e.nodeName.toLowerCase())return"/HTML";if("body"===e.nodeName.toLowerCase())return"/HTML/BODY";if("head"===e.nodeName.toLowerCase())return"/HTML/HEAD";let n=0;const i=null==(r=e.parentElement)?void 0:r.children;if(!i)return"";for(let o=0;o{const i=t[n],o=e.getAttribute(i)||"";return e.hasAttribute&&e.hasAttribute(i)&&""!==o?r+";"+n+":"+m(o):r}),"|"+r)}const g=new RegExp("^(data:)"),h=new RegExp("(.)(gif|jpe?g|tiff?|png|webp|bmp)","i"),A=e=>{if(g.test(e))return e;e&&(e=e.replace(/^(http|https)(:\/\/)/,"").replace(/^(www\.)/,""));const t=e.match(h);return(null==t?void 0:t.index)&&(null==t?void 0:t.length)?e.substring(0,t.index+t[0].length):e.split("?")[0]},y=(e,t,r=!1)=>e.reduce(((e,n)=>{const i=r&&n.position?":nth-of-type("+n.position+")":"";return e+=n.tag+i+(n.idx>=t?">":" ")}),"").slice(0,-1),E=(e,t)=>{if(null===t)return!0;const r=e.innerText?m(e.innerText).toString():"";if(t.innerText.toString()!==r)return!1;const n=e.hasAttribute("href")?m(e.getAttribute("href")).toString():"";if(t.href&&t.href!==n)return!1;const i=e.hasAttribute("src")?m(e.getAttribute("src")).toString():"";return!t.src||t.src===i},v=(e,t=null,r)=>{const n=(i=e,[].slice.call(document.querySelectorAll(i)));var i;if(1===n.length){if(null==r.params)return n[0];if(E(n[0],t))return n[0]}if(n.length>1){if(null==r.params)return null;const e=n.filter((e=>E(e,t)));if(1===e.length)return e[0]}return null};var w=(e=>(e[e.Strict=0]="Strict",e[e.Medium=1]="Medium",e[e.Loose=2]="Loose",e))(w||{});const T={i:"innerText",s:"src",h:"href"},N=e=>{const[t,r]=e.split("|");let n={innerText:""};if(r){const[e,...t]=r.split(";");n.innerText=e,t.forEach((e=>{const[t,r]=e.split(":");n[T[t]]=r}))}return{xpath:t,params:n}},_=e=>{const{xpath:t,params:r}=N(e),n=((e,t)=>{const r=("/"===e[0]?e.slice(1):e).split("/");return r.map(((e,n)=>{const i=e.toLowerCase(),[,o,a]=i.match(/(\S+)\[(\S+)?\]/)||[,i],l=r.length-1===n,s={idx:n,tag:o};return a&&(s.position=+a),l&&t&&(s.params=t),s}))})(t,r);return((e,t=4)=>{let r=e.length-2-t;const n=e[e.length-1];let i;const o=n.params;if(r<0){i=y(e,0,!0);return v(i,o,n)||(i=y(e,0),v(i,o,n))}const a=a=>{for(r=e.length-2-t;r>=0;r--){i=a===w.Loose?y(e.slice(0,2).concat(...e.slice(-r-t)),e.length-t):y(e,e.length-t-r-1,a===w.Strict);const l=v(i,o,n);if(l)return l}},l=[w.Strict,w.Medium,w.Loose];for(let s=0;s{const{xpath:t,params:r}=N(e),n=document.evaluate(t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue;return n&&E(n,r)?n:null},I=e=>{let t=e.closest("label"),r="";if(t){for(let e of t.childNodes)e.nodeType===Node.TEXT_NODE&&(r+=e.textContent);if(r.trim())return r.trim()}if(e.id){let t=(e=>{const t=document.querySelectorAll("LABEL");for(let r=0;re.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),R=e=>{try{const t=new URL(e);return["http:","https:"].includes(t.protocol)}catch(t){return!1}},k=e=>!(e instanceof HTMLElement)||O.some((t=>e.hasAttribute(t)))||S.some((t=>e.classList.contains(t)))||L.includes(e.nodeName.toLowerCase()),M=(e,t)=>{try{if("childList"===t){const t=[...e.addedNodes].reduce(((e,t)=>{if(t instanceof HTMLElement){const r=[...t.getElementsByTagName("*")];return[...e,...r]}return e}),[]);return[].filter.call([...e.addedNodes,...t],(e=>!k(e)))}return"attributes"===t?k(e.target)?[]:[e.target]:[]}catch(r){return[]}},D=e=>__async(this,null,(function*(){const t=yield fetch(e);return yield t.json()})),P={AriaEditorValues:[],BrokenLink:[],Contrast:[],EmptyControls:[],ExternalLink:[],Forms:[],Headings:[],Language:[],MissingAlts:[],Pdfs:[],VagueLinks:[]},B=UserWayWidgetApp.ContextHolder.config.remediation,U=UserWayWidgetApp.ContextHolder.config.tunings,W=UserWayWidgetApp.ContextHolder.config.services,j=UserWayWidgetApp.ContextHolder.config.imageAlt,{isMobile:H,language:$}=UserWayWidgetApp.ContextHolder.config;let F={};function V(e){F=__spreadValues({},e)}function q(){return F}const X=()=>__async(this,null,(function*(){if(null==B?void 0:B.consolidated){const e=yield D(B.consolidated);return e.MissingAlts.reverse(),void V(e)}V(P)})),G="https://api.userway.org/api/";var K=(e=>(e.Remediation="remediation",e.AriaEditor="aria-editor",e))(K||{}),z=(e=>(e.KeyboardNavEnabled="app-key-nav-enabled",e))(z||{});const Z=e=>{const t=UserWayWidgetApp.getLib("util"),{registerPostMessageListener:r}=t;return r((t=>{var r;(null==(r=null==t?void 0:t.data)?void 0:r.isUserWay)&&e(t)}))},Y=document.documentElement,Q={attributes:!0,attributeFilter:["aria-label","alt"],childList:!0,subtree:!0},J=new Set,ee=e=>{J.add(e)},te=new MutationObserver((e=>{const t=(e=>{const t=[];for(const r of e)t.push(...M(r,r.type));return t})(e);t.length&&J.forEach((e=>e(t)))})),re=[{src:"wave.min.js",name:"Wave"},{src:"axe.min.js",name:"BrowserStack"}],ne=[{url:"wave.webaim.org",name:"Wave"}],ie=(e,t)=>{try{const r=[];return"childList"===t&&e.addedNodes.length&&e.addedNodes.forEach((e=>{const t=(e=>{if("script"===e.nodeName.toLowerCase()){const t=re.find((t=>e.src.includes(t.src)));if(t)return t}return"iframe"===e.nodeName.toLowerCase()&&e.title.toLowerCase().includes("equalweb")?{name:"EqualWeb"}:null})(e);t&&r.push(t)})),r}catch(r){return[]}},oe=(e,t)=>__async(this,null,(function*(){const{account:r}=UserWayWidgetApp.ContextHolder.config,n={date:(new Date).toISOString(),url:window.location.href,scannerName:e,a11yScore:t};yield fetch(`${G}scaner-activity/${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}).catch((e=>{console.log(e)}))})),ae=e=>{try{UserWayWidgetApp.getLib("scan_manager").accessibilityScore().then((t=>{oe(e,t)}))}catch(t){console.log(t)}},le=document.documentElement,se={childList:!0,subtree:!0},ue=new MutationObserver((e=>{const t=(e=>{const t=[];for(const r of e)t.push(...ie(r,r.type));return t})(e)[0];t&&ae(t.name)}));const ce="object"==typeof global&&global&&global.Object===Object&&global;var de="object"==typeof self&&self&&self.Object===Object&&self;const pe=ce||de||Function("return this")();const me=pe.Symbol;var fe=Object.prototype,be=fe.hasOwnProperty,ge=fe.toString,he=me?me.toStringTag:void 0;var Ae=Object.prototype.toString;var ye="[object Null]",Ee="[object Undefined]",ve=me?me.toStringTag:void 0;function we(e){return null==e?void 0===e?Ee:ye:ve&&ve in Object(e)?function(e){var t=be.call(e,he),r=e[he];try{e[he]=void 0;var n=!0}catch(o){}var i=ge.call(e);return n&&(t?e[he]=r:delete e[he]),i}(e):function(e){return Ae.call(e)}(e)}var Te="[object Symbol]";var Ne=/\s/;var _e=/^\s+/;function xe(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&Ne.test(e.charAt(t)););return t}(e)+1).replace(_e,""):e}function Ie(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var Le=NaN,Se=/^[-+]0x[0-9a-f]+$/i,Oe=/^0b[01]+$/i,Ce=/^0o[0-7]+$/i,Re=parseInt;function ke(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return null!=e&&"object"==typeof e}(e)&&we(e)==Te}(e))return Le;if(Ie(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Ie(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=xe(e);var r=Oe.test(e);return r||Ce.test(e)?Re(e.slice(2),r?2:8):Se.test(e)?Le:+e}const Me=function(){return pe.Date.now()};var De="Expected a function",Pe=Math.max,Be=Math.min;function Ue(e,t,r){var n,i,o,a,l,s,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError(De);function m(t){var r=n,o=i;return n=i=void 0,u=t,a=e.apply(o,r)}function f(e){var r=e-s;return void 0===s||r>=t||r<0||d&&e-u>=o}function b(){var e=Me();if(f(e))return g(e);l=setTimeout(b,function(e){var r=t-(e-s);return d?Be(r,o-(e-u)):r}(e))}function g(e){return l=void 0,p&&n?m(e):(n=i=void 0,a)}function h(){var e=Me(),r=f(e);if(n=arguments,i=this,s=e,r){if(void 0===l)return function(e){return u=e,l=setTimeout(b,t),c?m(e):a}(s);if(d)return clearTimeout(l),l=setTimeout(b,t),m(s)}return void 0===l&&(l=setTimeout(b,t)),a}return t=ke(t)||0,Ie(r)&&(c=!!r.leading,o=(d="maxWait"in r)?Pe(ke(r.maxWait)||0,t):o,p="trailing"in r?!!r.trailing:p),h.cancel=function(){void 0!==l&&clearTimeout(l),u=0,n=s=i=l=void 0},h.flush=function(){return void 0===l?a:g(Me())},h}function We(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Ie(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ue(e,t,{leading:n,maxWait:t,trailing:i})}const je="AUTO";let He=!0;var $e=(e=>(e.TABINDEX="tabindex",e.ROLE="role",e.TYPE="type",e.SRC="src",e.ARIA_LEVEL="ariaLevel",e.ORIGINAL_ALT="originalAlt",e))($e||{}),Fe=(e=>(e.UNKNOWN="UNKNOWN",e.NOT_ALLOWED="NOT_ALLOWED",e.TEXT_NODE="TEXT_NODE",e.LANDMARK="LANDMARK",e.CONTROL="CONTROL",e.HEADING="HEADING",e.HAS_ALT_DESCRIPTION="HAS_ALT_DESCRIPTION",e.COMPOSED_TEXT_NODES="COMPOSED_TEXT_NODES",e.IFRAME="IFRAME",e.HIDDEN_FOR_READER="HIDDEN_FOR_READER",e))(Fe||{}),Ve=(e=>(e.UNKNOWN="unknown",e.TEXT="text",e.IMAGE="image",e.HEADING="heading",e.FOOTER="footer",e.HEADER="header",e.NAV="nav",e.MAIN="main",e.FORM="form",e.LANDMARK="landmark",e.LINK="link",e.BUTTON="button",e.CHECKBOX="checkbox",e.RADIOBUTTON="radiobutton",e.INPUT="input",e.TEXTAREA="textarea",e.SELECT="select",e.ABBR="abbr",e.LIST_ITEM="list item",e))(Ve||{});const qe="accessibility-tree-observer",Xe=["uw-sl","uwy","uw-s10-reading-guide","uw-s12-tooltip"],Ge=(e,t)=>t.ariaLabel?t.ariaLabel:t.ariaLabelledBy?s(t.ariaLabelledBy):l(e,""),Ke={},ze=UserWayWidgetApp.getLib("accessibility_tree_walker");let Ze,Ye=[],Qe=1;const Je=(e,t)=>{var r;if(Ye=[],(e=>{const t=3===e.nodeType;return Xe.some((t=>!!e.closest&&e.closest(`.${t}`)))||!t&&e.hasAttribute("data-uw-rm-ignore")})(e)&&!t)return null;const n={node:e,type:ze.identifyElementType(e)},i=(e=>{if(!e||!e.type)return{};const{node:t}=e;return[Fe.UNKNOWN,Fe.NOT_ALLOWED,Fe.TEXT_NODE].includes(e.type)?{uwAtoId:t.uwAtoId}:{tagName:t.tagName,tabindex:t.getAttribute("tabindex")||"",role:t.getAttribute("role")||"",ariaLevel:t.getAttribute("aria-level")||"",ariaLabel:t.getAttribute("aria-label")||"",ariaLabelledBy:t.getAttribute("aria-labelledby")||"",type:t.getAttribute("type")||"",uwAtoId:t.uwAtoId}})(n);Ze=ze.identifyElementType(e);const o=Ze===Fe.HIDDEN_FOR_READER;let a,u;switch(Ye=(e=>(e.tabindex&&Ye.push({name:$e.TABINDEX,value:e.tabindex}),e.role&&Ye.push({name:$e.ROLE,value:e.role}),e.type&&Ye.push({name:$e.TYPE,value:e.type}),e.ariaLevel&&Ye.push({name:$e.ARIA_LEVEL,value:e.ariaLevel}),Ye))(i),o&&((e,t)=>{const r=e.cloneNode(!0);r.removeAttribute("aria-hidden"),Ze=ze.identifyElementType(r),Ze!==Fe.UNKNOWN||"IMG"!==t.tagName&&"img"!==t.role||(Ze=Fe.HAS_ALT_DESCRIPTION)})(e,i),Ze){case Fe.TEXT_NODE:a=(e=>{const t=Ve.TEXT;let r="";e.textContent&&(r=e.textContent.trim().replace(/(\n|\r\n)/g,"").replace(/\s+/g," "));const n={};return e.parentElement&&(n.parentXpath=f(e.parentElement)),{semanticType:t,textToRead:r,additionalParams:n}})(e),Ke.parentXpath=null==(r=a.additionalParams)?void 0:r.parentXpath;break;case Fe.COMPOSED_TEXT_NODES:a=((e,t)=>({semanticType:"LI"===t.tagName?Ve.LIST_ITEM:Ve.TEXT,textToRead:t.ariaLabel||l(e,"")}))(e,i);break;case Fe.HIDDEN_FOR_READER:a={semanticType:Ve.UNKNOWN,textToRead:""};break;case Fe.HEADING:a=((e,t)=>({semanticType:Ve.HEADING,textToRead:t.ariaLabel||l(e,"")}))(e,i);break;case Fe.LANDMARK:a=(e=>{let t,r="";e.ariaLabel?r=e.ariaLabel:e.ariaLabelledBy&&(r=s(e.ariaLabelledBy));const{tagName:n}=e,{role:i}=e;return t="FOOTER"===n||"contentinfo"===i?Ve.FOOTER:"HEADER"===n||"banner"===i?Ve.HEADER:"FORM"===n||"form"===i?Ve.FORM:"MAIN"===n||"main"===i?Ve.MAIN:"NAV"===n||"navigation"===i?Ve.NAV:Ve.LANDMARK,{semanticType:t,textToRead:r}})(i);break;case Fe.CONTROL:a=((e,t)=>{const{tagName:r,role:n,type:i,ariaLabel:o,ariaLabelledBy:a}=t;let l=!1,u="",c=Ve.TEXT;return"menuitem"===n||"option"===n?(u=Ge(e,t),l=!0):"link"===n||"A"===r&&!n?(c=Ve.LINK,u=Ge(e,t),l=!0):"button"===n||"BUTTON"===r?(c=Ve.BUTTON,u=Ge(e,t),l=!0):"INPUT"!==r||"button"!==i&&"submit"!==i&&"reset"!==i||(c=Ve.BUTTON,o?u=o:a&&(u=s(a)),l=!0),l||(u=I(e),"checkbox"===n||"INPUT"===r&&"checkbox"===i?c=Ve.CHECKBOX:"radio"===n||"INPUT"===r&&"radio"===i?c=Ve.RADIOBUTTON:"INPUT"===r&&(c=Ve.INPUT),"TEXTAREA"===r&&(c=Ve.TEXTAREA),"SELECT"===r&&(c=Ve.SELECT)),{semanticType:c,textToRead:u}})(e,i);break;case Fe.HAS_ALT_DESCRIPTION:a=((e,t,r)=>{const{tagName:n,role:i,ariaLabel:o}=t,a=e.getAttribute("alt")||"",l=e.getAttribute("title")||"",s=e.getAttribute("data-uw-rm-ima-original")||"";let u="",c=Ve.TEXT;const d=r;return"IMG"!==n&&"img"!==i||(c=Ve.IMAGE,d.push({name:$e.SRC,value:e.src}),d.push({name:$e.ORIGINAL_ALT,value:s}),u=o||a||s||u),"ABBR"===n&&(c=Ve.ABBR,u=l),{semanticType:c,textToRead:u,attributesToReturn:d}})(e,i,Ye),a.attributesToReturn&&(Ye=a.attributesToReturn);break;case Fe.UNKNOWN:a=((e,t)=>{let r=Ve.TEXT;return"DIV"!==t.tagName||e.innerHTML||(r=Ve.LANDMARK),{semanticType:r,textToRead:""}})(e,i);break;default:a={textToRead:"",semanticType:Ve.TEXT}}return i.uwAtoId?u=i.uwAtoId:(u=Qe,Qe+=1,n.node.uwAtoId=u),__spreadValues({id:u,xpath:f(e),label:a.textToRead.replace(/\|/g,"").trim(),tagName:i.tagName||"",type:a.semanticType,hidden:o,attributes:Ye,el:n.node},Ke)},et=UserWayWidgetApp.getLib("accessibility_tree_walker");let tt=[];const rt=()=>{let t=null;tt=[];do{const e=et.getNextAccessibilityTreeNode(t);if(!e)break;const r=Je(e.node);r&&tt.push(r),t=e.node}while(t);tt=tt.map((e=>{const t=e,{el:r}=t;return __objRest(t,["el"])})),e({action:qe,type:"userway:ato-output:get",data:{nodes:tt,version:Date.now()}},["uwAccessibilityEditor"])},nt=()=>tt,it={enabled:!1},ot={"userway:ato-input:enable":()=>{it.enabled||(it.enabled=!0,ee(rt),rt())},"userway:ato-input:disable":()=>{var e;it.enabled&&(it.enabled=!1,e=rt,J.delete(e))},"userway:ato-input:get":rt},at={automaticcoupons:/automaticcoupons/,"shopping.yahoo":/shopping\.yahoo/,shopperapproved:/shopperapproved/,rakuten:/rakuten/,"translate.google":/translate\.google/,"maps.googleapis.com":/maps\.googleapis\.com/,"s.w.org":/s\.w\.org/,avatar:/avatar/,companylogos:/companylogos/,favicon:/favicon/,activecampaign:/lt\.php(.*)?l=open/,aweber:/openrate\.aweber\.com/,bananatag:/bl-1\.com/,boomerang:/mailstat\.us\/tr/,"campaign monitor":/cmail(\d+)\.com\/t\//,"cirrus insight":/tracking\.cirrusinsight\.com/,close:/close\.com\/email_opened/,"constant contact":/rs6\.net\/on\.jsp/,contactmonkey:/contactmonkey\.com\/api\/v1\/tracker/,convertkit:/convertkit-mail\.com\/o/,"critical impact":/portal\.criticalimpact\.com\/c2\//,emarsys:/emarsys\.com\/e2t\/o/,gem:/zen\.sr\/o/,getnotify:/email81\.com\/case/,getresponse:/getresponse\.com\/open\.html/,growthdot:/growthdot\.com\/api\/mail-tracking/,front:/app\.frontapp\.com\/(.*)?\/seen/,hubspot:/t\.(hubspotemail|hubspotfree|signaux|senal|sidekickopen|sigopn)/,icontact:/click\.icptrack\.com\/icp/,intercom:/(via\.intercom\.io\/o)|(intercom-mail\.com\/via\/o)/,litmus:/emltrk\.com/,mailchimp:/list-manage\.com\/track/,mailgun:/email\.(mailgun|mg)(.*)?\/o/,mailjet:/mjt\.lu\/oo/,mailspring:/getmailspring\.com\/open/,mailtrack:/(mailtrack\.io\/trace)|(mltrk\.io\/pixel)/,mandrill:/mandrillapp\.com\/track/,marketo:/resources\.marketo\.com\/trk/,mixmax:/(email|track)\.mixmax\.com/,mixpanel:/api\.mixpanel\.com\/track/,nethunt:/nethunt\.co(.*)?\/pixel\.gif/,newton:/tr\.cloudmagic\.com/,outreach:/api\/mailings\/opened/,phplist:/phplist\.com\/lists\/ut\.php/,polymail:/polymail\.io/,postmark:/pstmrk\.it\/open/,"return path":/returnpath\.net\/pixel\.gif/,sailthru:/sailthru\.com\/trk/,salesforce:/nova\.collect\.igodigital\.com/,sendgrid:/wf\/open\?upn/,sendy:/sendy\/t\//,streak:/mailfoogae\.appspot\.com/,superhuman:/r\.superhuman\.com/,thunderhead:/na5\.thunderhead\.com/,tinyletter:/tinyletterapp\.com.*open\.gif/,yamm:/yamm-track\.appspot/,yesware:/t\.yesware\.com/,"zendesk sell":/futuresimple\.com\/api\/v1\/sprite\.png/,bing:/bat\.bing\.com/,teads:/cm\.teads\.tv/},lt=["icon","cart","logo"],st=["h1","h2","h3","h4","h5","h6","span","a","p","figcaption","caption","div"],ut=["heading"],ct=new RegExp("^(data:)"),dt=new RegExp(/^.+\.svg$/);var pt=(e=>(e.EXCLUDED_SRC="EXCLUDED_SRC",e.HIDDEN_FROM_SCREEN_READER="HIDDEN_FROM_SCREEN_READER",e.BASE64="BASE64",e.SVG="SVG",e.SMALL_SIZE="SMALL_SIZE",e.MICRO_SIZE="MICRO_SIZE",e.WRONG_SRC="WRONG_SRC",e.ASPECT_RATIO="ASPECT_RATIO",e.CUSTOM_CONFIG="CUSTOM_CONFIG",e))(pt||{});const mt=["SVG","SMALL_SIZE","HIDDEN_FROM_SCREEN_READER"],ft="data-uw-rm-alt-original",bt="REMEDIATION_IMAGE_MISSING_ALT",gt="data-uw-rm-alt",ht=["jpg","jpeg","png","gif","bmp","tiff","tif","svg","webp","ico","apng","heif","heic","avif","eps","raw","cr2","nef","orf","sr2"];var At=(e=>(e.CorrectAlt="ALT",e.Reverted="RT",e.Backend="BE",e.Excluded="EX",e.Hidden="HD",e.Base64="BS64",e.Svg="SVG",e.Small="SM",e.Micro="MC",e.InvalidSrc="SRC",e.AspectRatio="AR",e.AI="AI",e.AIQuotaExceed="QU",e.ClosestText="CT",e.CustomConfig="CC",e.NotLoaded="NL",e))(At||{});const yt="uwAccessibilityEditor",Et=W.editorBuildUrl,vt="aria-editor",wt="data-uw-rm-ae",Tt="aria-editor",Nt="REMEDIATION_EMPTY_CONTROLS",_t="data-uw-rm-empty-ctrl",xt=["facebook","youtube","whatsapp","instagram","twitter","reddit","linkedin","viber","pinterest","telegram","search","cart","home"],It={prev:"Get previous item",next:"Get next item",scroll:"Activate for scroll",top:"Move to top",bottom:"Move to bottom",expand:"Expand this block",collapse:"Collapse this block",close:"Close this option"},Lt=[{re:/(fa-)(.+)/,replacer:"$2"}],St="REMEDIATION_FORM_LABEL",Ot="data-uw-rm-form",Ct=["INPUT","TEXTAREA","SELECT"],Rt="data-uw-hidden-control",kt="hidden-control-element",Mt={text:"Text field",radio:"Radio button",checkbox:"Checkbox field",email:"Please enter email address",url:"Please enter url",tel:"Please enter a phone number",password:"Password field",search:"Search field",date:"Date field",time:"Time field",image:"Image field",file:"File field",number:"Number",range:"Select range",submit:"Submit button",color:"Select color",datetime_local:"Date and time field",month:"Month field",week:"Week field",button:"Button",reset:"Reset button"},Dt=new Map([["Name",/(name)/],["Age",/(age)/],["Search",/(search|srch)/],["Quantity",/(qua|qty|quantity)/],["Count",/(count|cnt)/]]),Pt=new Map([["Search",/(search|srch)/],["Select name",/(name)/]]),Bt="REMEDIATION_BROKEN_LINK",Ut="data-uw-rm-brl",Wt="data-uw-original-href";var jt=(e=>(e.Processed="PR",e.BackEndContributed="BE",e.Fixed="FX",e.FixedByCorrection="CR",e))(jt||{});const Ht=["localhost","userway.dev","linkedin.com","youtube.com"],$t="REMEDIATION_META_VIEWPORT",Ft="uw-rm-meta-viewport",Vt='meta[name="viewport"][content*="maximum-scale"], meta[name="viewport"][content*="user-scalable=0"], meta[name="viewport"][content*="user-scalable=no"]',qt=e=>e.filter((e=>{var t,r;const n=(e=>{switch(e){case bt:return"alt";case vt:return"ariaEditor";case Nt:return"emptyControls";case St:return"forms";case Bt:return"brokenLinks";case $t:return"metaViewport";default:return null}})(e.ruleId);if(!n||!W.paidAi)return!0;const i=B[n];if(!i)return!0;const o=!1!==(null==(r=null==(t=i.config)?void 0:t.mobile)?void 0:r.enabled);return i.enabled&&(!H||o)})),Xt=(e,t)=>{if(0===e.length)return Promise.resolve();const r=e[0];return Promise.all(r.map((e=>e(t)))).then((()=>Xt(e.slice(1),t)))},Gt=(()=>{let e,t=!1,r=[],n=null;const i=o=>{if(!o.length)return;if(t)return n&&clearTimeout(n),void(n=setTimeout((()=>{i(r),n=null}),800));t=!0;const a=()=>{t=!1};((e,t)=>{const r=e.map((e=>e.map((e=>e.run))));return Xt(r,t)})(e,o).then(a).catch(a),r=[]},{run:o}=(e=>{setTimeout((()=>{He=!1}),2e3);const t=We((t=>e(t)),300,{leading:!0,trailing:!0}),r=Ue((t=>e(t)),500,{maxWait:2e3,leading:!0,trailing:!0});return{run:e=>He?t(e):r(e)}})(i),a=e=>{r.push(...e),o(r)},l=()=>{const e=(()=>{const e=L.join(","),t=O.map((e=>`[${e}]`)).join(","),r=`${e},${t}`;return[...document.body.querySelectorAll(`*:not(${r})`),document.documentElement].filter((e=>!e.closest(t))).map((e=>e))})();o([...e]),Z((e=>{if(!e.data)return;const{data:{action:t,type:r}}=e;t===qe&&ot[r]&&ot[r]()})),ee(a)};return{run:o,init:()=>__async(this,null,(function*(){if((()=>{var e;if((null==(e=window.location)?void 0:e.pathname.indexOf("wp-admin"))>-1)return!0;if(!(null==B?void 0:B.commonSettings))return!1;const{mobile:t,disabledPages:r}=B.commonSettings.config;return!(!H||!t||t.enabled)||!!(null==r?void 0:r.some((e=>{var t;return(null==(t=window.location)?void 0:t.href.indexOf(e))>-1})))})())return;const t=yield Promise.resolve().then((()=>qi));e=t.RulesGroups.map((e=>qt(e))),U.tech_rem_on_tab||l();const r=Z((e=>{var t;(null==(t=null==e?void 0:e.data)?void 0:t.type)===z.KeyboardNavEnabled&&(l(),r())}))})),onDomUpdates:a}})();(()=>{__async(this,null,(function*(){var e;yield X();const t=null!=(e=U.tech_rem_in_throttle_ms)?e:500;setTimeout((()=>{Gt.init(),((e=Y,t=Q)=>{U.tech_rem_on_tab||te.observe(e,t);const r=Z((n=>{var i;(null==(i=null==n?void 0:n.data)?void 0:i.type)===z.KeyboardNavEnabled&&(te.observe(e,t),r())}))})()}),t)}))})(),ue.observe(le,se),(()=>{const e=ne.find((e=>e.url.includes(window.location.origin)));e&&ae(e.name)})();const Kt=({ruleId:e,isTargetElement:t,rule:r,postMessageApi:n,forceRun:i})=>(n&&Z((e=>{const t=null==e?void 0:e.data;if(!t)return;const{type:r,action:i}=t;i!==K.Remediation&&i!==K.AriaEditor||n[r]&&n[r](t.data?t.data:t)})),{run:n=>__async(this,null,(function*(){try{if(!t)return void(yield r({context:{elements:n}}));const o=n.filter((r=>!r.hasAttribute(`uw-ignore-${e}`)&&t(r)));if(!o.length)return void(i&&(yield r({context:{elements:[]}})));yield r({context:{elements:o}})}catch(o){console.warn(o)}})),stop:()=>{},rerun:()=>{},ruleId:e}),zt=e=>{if(!e)return null;const t=e.split("|")[0];return document.evaluate(t,document,null,XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue},Zt=e=>!!["input","select","button","textarea","a"].includes(e.tagName.toLowerCase())||["button","checkbox","link","option"].includes((e.getAttribute("role")||"").toLowerCase()),Yt=e=>{const t=e.getAttribute("tabindex");if(null!==t){const e=parseInt(t,10);if(!Number.isNaN(e))return e}},Qt=e=>{if(Zt(e))return!0;const t=Yt(e);return void 0!==t&&!Number.isNaN(t)&&t>=0},Jt=e=>!!L.includes(e.toLowerCase()),er=(e,t)=>("img"===e?t.getAttribute("alt"):t.getAttribute("aria-label"))||null,tr=e=>e.getAttribute("role")||null,rr=e=>e.getAttribute("aria-level")||null,nr=(e,t)=>"img"===e?t.getAttribute("src"):null,ir=e=>{if(null==e?void 0:e.nextElementSibling){const t=e.nextElementSibling;return Jt(t.tagName)?ir(t):t}return null},or=e=>{if(null==e?void 0:e.previousElementSibling){const t=e.previousElementSibling;return Jt(t.tagName)?or(t):t}return null},ar=e=>{var t;return null!=(t=e.uwAtoId)?t:null},lr=e=>{if(!e.parentElement)return null;const{parentElement:t}=e,r=f(t);return nt().find((e=>e.xpath===r))?r:lr(t)},sr=e=>{const t=Array.from(e.childNodes).find((e=>e.uwAtoId));if(t){const e=f(t);return nt().find((t=>t.xpath===e))?e:null}return null},ur=(e,t)=>{if(!e)return;const r=e,{tabindex:n,el:i}=r,o=__objRest(r,["tabindex","el"]),a=e.el?[...e.el.children]:[],l=t.filter((e=>a.includes(e.el)));if(l.length){const e=l.map((e=>ur(e,t)));return __spreadProps(__spreadValues({},o),{children:e})}return o},cr=(t,r="")=>{const n=[t];t.parentElement&&n.push(t.parentElement);let i=0;const o=(null==t?void 0:t.children)?[...t.children].filter((e=>!Jt(e.tagName))).reverse():[];o.length&&(n.unshift(...o),i+=o.length);const a=ir(t);a&&!n.includes(a)&&(n.splice(i,0,a),i+=1);const l=or(t);l&&!n.includes(l)&&n.splice(i+1,0,l);const s=n.map((e=>{const r=e.tagName.toLowerCase(),n=Je(e,!0);if(!n)return null;const{type:i,label:o,id:a}=n,l="function"==typeof e.getAttribute?{label:er(r,e),isHidden:(s=e,"true"===s.getAttribute("aria-hidden")||"presentation"===s.getAttribute("role")),role:tr(e),ariaLevel:rr(e),src:nr(r,e),isControl:Zt(e),focusable:Qt(e),tabindex:Yt(e)}:{};var s;return __spreadValues({tagName:r,text:[...e.childNodes].filter((e=>e.nodeType===Node.TEXT_NODE)).map((e=>{var t;return null==(t=e.textContent)?void 0:t.trim()})).join(" ").trim(),id:a,xpath:f(e),selected:e===t,el:e,semanticType:i,textToRead:o,uwAtoId:ar(e),accessibleParentXpath:lr(e),accessibleChildXpath:sr(e)},l)})).filter(Boolean).reverse();if(s){const t=ur(s[0],s);t&&e({action:Tt,type:"elements-selected",data:{tree:t,source:r}},[yt])}};let dr,pr;let mr;const fr=(e,t)=>{const r="img"===(null==e?void 0:e.tagName.toLowerCase());t&&!r&&e.setAttribute("aria-label",t)},br=(e,t)=>{const{tabindex:r,role:n,ariaLevel:i}=t;r&&e.setAttribute("tabindex",r),n&&"no role"!==n?e.setAttribute("role",n):n&&"no role"!==n||e.removeAttribute("role"),i&&e.setAttribute("aria-level",i)},gr=Kt({ruleId:vt,rule:()=>{if(B.ariaEditor.enabled&&(mr=(()=>{let e=q().AriaEditorValues;const t=`${m(window.location.pathname)}`;return e=e.filter((e=>!e.page||e.page===t)).sort((e=>e.page?-1:1)),e})(),mr))for(const e of mr){const t=zt(e.xpath);if(!t)continue;const r=t.nodeType===Node.ELEMENT_NODE,n=t.hasAttribute(wt)&&e.processed;if(!r||n)continue;const{hidden:i,correction:o}=e;i&&t.setAttribute("aria-hidden","true"),fr(t,o),br(t,e),t.setAttribute(wt,""),e.processed=!0}},postMessageApi:{"add-aria-editor":()=>{pr=document.querySelector(`iframe[name=${yt}]`),pr||(dr=new Promise((e=>{const t={class:"userway_iframe_aria_editor",name:"uwAccessibilityEditor",title:"Aria Editor",style:"\n z-index: 2147483647;\n position: fixed;\n left: 0;\n top: 0;\n width: 100%!important;\n max-width: 100%!important;\n height: 100%!important;\n max-height: 100%!important;\n visibility: hidden;\n opacity: 0!important;\n border: none;\n ",src:Et};pr=document.createElement("iframe"),Object.entries(t).forEach((([e,t])=>{null==pr||pr.setAttribute(e,t)})),pr.onload=()=>{e()},pr&&document.body.appendChild(pr)})))},"open-aria-editor":()=>{dr.then((()=>{window.parent.postMessage({action:"close",isUserWay:!0}),window.parent.postMessage({action:"manageIconVisibility",isUserWay:!0,type:"hidden"}),pr&&(pr.style.visibility="visible",pr.style.opacity="1"),e({action:Tt,type:"aria-editor-open-request"},[yt])}))},"close-aria-editor":()=>{window.parent.postMessage({action:"open",isUserWay:!0}),window.parent.postMessage({action:"manageIconVisibility",isUserWay:!0,type:"visible"}),pr&&(pr.style.visibility="hidden",pr.style.opacity="0"),e({action:Tt,type:"aria-editor-closed"},[yt])},"editor-init":()=>{const t=W,r=!(!t||!t.CUSTOM_BRANDING&&!t.WHITE_LABEL);e({action:Tt,type:"open-aria-editor",data:{siteId:W.siteId,showTutorial:!0,whiteLabel:r,hash:m(window.location.pathname)}},[yt])},"update-aria-hidden":e=>{const{xpath:t,hidden:r}=e;if(!t)return;const n=x(t);(null==n?void 0:n.nodeType)===Node.ELEMENT_NODE&&(r?n.setAttribute("aria-hidden","true"):n.removeAttribute("aria-hidden"),n.setAttribute(wt,""))},"update-tabindex":e=>{const{xpath:t,focusable:r,isControl:n}=e;if(!t)return;const i=x(t);(null==i?void 0:i.nodeType)===Node.ELEMENT_NODE&&(n?i[r?"removeAttribute":"setAttribute"]("tabindex","-1"):i[r?"setAttribute":"removeAttribute"]("tabindex","0"),i.setAttribute(wt,""))},"update-aria-label":e=>{const{xpath:t,label:r}=e;if(!t||null==r)return;const n=x(t);(null==n?void 0:n.nodeType)===Node.ELEMENT_NODE&&(n.setAttribute("aria-label",e.label),n.setAttribute(wt,""))},"update-aria-level":e=>{const{xpath:t,ariaLevel:r}=e;if(!t)return;const n=x(t);(null==n?void 0:n.nodeType)===Node.ELEMENT_NODE&&(r?n.setAttribute("aria-level",r):n.removeAttribute("aria-level"),n.setAttribute(wt,""))},"update-role":e=>{const{xpath:t,role:r}=e;if(!t)return;const n=x(t);if((null==n?void 0:n.nodeType)===Node.ELEMENT_NODE){r&&"no role"!==r?n.setAttribute("role",r):n.removeAttribute("role"),n.setAttribute(wt,"")}},"select-elements-by-xpath":e=>{const{xpath:t,source:r}=e;if(!t)return;const n=x(t);n&&cr(n,r)},"select-elements-at-point":e=>{const{position:{x:t,y:r}}=e;let n=document.elementsFromPoint(t,r);const i=n.findIndex((e=>e.getAttribute("name")===yt));-1!==i&&n.splice(i,1),n=n.filter((e=>!["HTML","BODY"].includes(e.tagName))).slice(0,2),n.length&&cr(n[0])},"update-aria-editor-config":e=>{const{page:t="",xpath:r=""}=e,n=q().AriaEditorValues.findIndex((e=>e.page===t&&e.xpath===r)),i=q().AriaEditorValues[n],o=__spreadValues(__spreadValues({},i),(e=>__spreadProps(__spreadValues({},e),{hidden:e.isHidden}))(e));-1!==n?q().AriaEditorValues[n]=o:q().AriaEditorValues.push(o)}}}),hr=({currentSrc:e,src:t})=>e||t,Ar=(e,t)=>{try{const{width:r,height:n}=window.getComputedStyle(e);return parseInt(r,10)>t&&parseInt(n,10)>t}catch(r){return!1}},yr=(e,{decorative:t,approved:r,fixedByUserWay:n,loadingFromMS:i})=>{var o;return{src:hr(e),alt:e.alt,originalAlt:null!=(o=e.getAttribute(ft))?o:"",decorative:t,approved:r,fixedByUserWay:n,loadingFromMS:i}},Er=e=>{e.setAttribute("role","presentation"),e.removeAttribute("aria-hidden"),e.setAttribute("alt","")},vr=e=>{if(!e)return"";try{const{hostname:t}=new URL(e);return t.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\.[a-zA-Z0-9]*$/,"")}catch(t){return""}},wr=e=>{const t=hr(e);return ct.test(t)},Tr=e=>{const t=e.trim(),r=new RegExp(`\\.(${ht.join("|")})$`,"i").test(t),n=t.length>500,i=!t,o=t.split(/\s+/).length,a=/[0-9]{5,}/.test(t)&&1===o,l=new RegExp(/^[!@#$%^&*()_+{}[\]`:;<>,.?~\\|\-="'/]+$/,"u").test(t);return a||r||n||i||l},{enabled:Nr,config:_r}=(null==B?void 0:B.alt)||{enabled:!1,config:{}},xr=null==_r?void 0:_r.decorative,Ir=(e,t="selectors")=>{if(!xr||!Nr)return!1;const r=xr[t];return!!Array.isArray(r)&&r.some((t=>e.matches(t)))},Lr=(e,t)=>{const r=t.alt.trim(),n=hr(t),i=e.find((e=>A(e.src).toLowerCase()===A(n).toLowerCase()));if(!i||null===i.alt)return null;const{decorative:o,alt:a,approved:l,reverted:s}=i;if(s&&!o)return t.setAttribute(gt,At.Reverted),yr(t,{approved:!0,decorative:!r,fixedByUserWay:!1,loadingFromMS:!1});const u=!(!B||"AUTO"===B.strategy)&&!l;!o||u||Ir(t,"ignoreSelectors")||Er(t);const c=l||!r||Tr(r);a&&!u&&c&&!o&&t.setAttribute("alt",a),t.setAttribute(gt,At.Backend);const d=yr(t,{approved:l,decorative:o,fixedByUserWay:!0,loadingFromMS:!1});return u&&(d.alt=a),d},Sr=e=>{if("string"!=typeof e)return!1;for(const t of Object.values(at)){const r=new RegExp(t,"i");if(e.match(r))return!0}return!1},Or=e=>{const{width:t,height:r}=window.getComputedStyle(e);try{if(0===parseFloat(t)&&0===parseFloat(r))return!1}catch(a){return!1}const n=/^\d*px?/i,i=n.test(t),o=n.test(r);return!(!i||!o)},Cr=e=>{if(Ir(e))return pt.CUSTOM_CONFIG;const t=hr(e),r=Tr(e.alt),n=Or(e);var i;if(!(i=t)||!i.match(ct)&&![/^https?:\/\/.{1,256}\.[a-z]{2,63}\/.+$/gim,/^https?:\/\/[^:\/\s]{1,256}:\d{1,5}\/.+$/gim].some((e=>e.test(i))))return pt.WRONG_SRC;if(Sr(t))return pt.EXCLUDED_SRC;if(!!n&&!Ar(e,15)&&r)return pt.MICRO_SIZE;if(!!n&&(e=>{try{const{width:t,height:r}=window.getComputedStyle(e),n=parseInt(t,10),i=parseInt(r,10);return!!(n<=20&&i>=10*n||i<=20&&n>=10*i)}catch(t){return!1}})(e))return pt.ASPECT_RATIO;if(wr(e)&&r)return pt.BASE64;if("true"===e.getAttribute("aria-hidden")||"presentation"===e.getAttribute("role")||"none"===e.getAttribute("role"))return pt.HIDDEN_FROM_SCREEN_READER;if(dt.test(t)&&r)return pt.SVG;return!(!n||Ar(e,50))&&r?pt.SMALL_SIZE:null},Rr=e=>{switch(e){case pt.ASPECT_RATIO:return At.AspectRatio;case pt.BASE64:return At.Base64;case pt.EXCLUDED_SRC:return At.Excluded;case pt.SVG:return At.Svg;case pt.MICRO_SIZE:return At.Micro;case pt.SMALL_SIZE:return At.Small;case pt.WRONG_SRC:return At.InvalidSrc;case pt.CUSTOM_CONFIG:return At.CustomConfig;case pt.HIDDEN_FROM_SCREEN_READER:default:return At.Hidden}},kr=(e,t,r,n)=>{const i=UserWayWidgetApp.getLib("remediation_manager"),o=UserWayWidgetApp.getLib("remediation_helper_outcome");if(!o.of)return;const a=o.of(e,{items:t},null,r,n);i.HelperCallbackAggregator.onHelperRemediationCompleted(a)},Mr=new Map,Dr=(e,t)=>{const r=f(e);Mr.set(r,t)},Pr=e=>{const t=f(e);return Mr.get(t)||null},Br=e=>kr(bt,e,e.filter((e=>e.fixedByUserWay)).length,e.filter((e=>!e.approved)).length),Ur=e=>{e.hasAttribute(ft)||e.setAttribute(ft,e.alt)},Wr=(e,t=[])=>{if(0===e.length)return;const{paidAi:r}=W,n=[];for(const i of e){const e=i,o=Tr(e.alt),a=hr(e),l=Pr(e),s=Ir(e,"ignoreSelectors");Ur(e),dt.test(a)&&r&&e.setAttribute("role","img");const u=Lr(t,e);if(u){n.push(u);continue}if(s){e.setAttribute(gt,Rr(pt.CUSTOM_CONFIG));continue}if(!r)continue;const c=null==l?void 0:l.shouldBeDecorativeReason;if(!o&&!c){e.setAttribute(gt,At.CorrectAlt),n.push(yr(e,{approved:!0,decorative:!1,fixedByUserWay:!1}));continue}if(void 0!==c){Er(e),e.setAttribute(gt,Rr(c)),c&&mt.includes(c)&&n.push(yr(e,{approved:!1,decorative:!0,fixedByUserWay:!0}));continue}const d=null==l?void 0:l.relevantText;if(d){e.setAttribute("alt",d),e.setAttribute(gt,At.ClosestText),n.push(yr(e,{approved:!1,decorative:!1,fixedByUserWay:!0}));continue}const{quota:p,usage:m}=j;m>=p?(e.setAttribute(gt,At.AIQuotaExceed),n.push(yr(e,{approved:!1,decorative:!1,fixedByUserWay:!0}))):(e.setAttribute(gt,At.AI),n.push(yr(e,{approved:!1,decorative:!1,fixedByUserWay:!0,loadingFromMS:!0})))}Br(n)},jr=e=>{const t=e.replace(/^https?:\/\//,"");return document.querySelectorAll(`img[src*="${t}" i],img[srcset*="${t}" i]`)},Hr=e=>__async(this,null,(function*(){const{account:t}=UserWayWidgetApp.ContextHolder.config,{siteId:r}=W,{resourceHash:n}=j,i=encodeURIComponent(e),o=yield fetch(`https://cdn77.api.userway.org/api/img-dscr/v2/${t}/${r}/${n}/alts.json?dto=${i}`,{method:"GET",headers:{"Content-Type":"application/json"}});return(yield o.json()).payload})),$r=e=>{const t=`(.*\\.(${ht.join("|")}))\\?.*$`,r=new RegExp(t),n=e.match(r);if(!n){const t=new URL(e),r=[];let n=!1;return t.searchParams.forEach(((e,t)=>{ht.some((t=>e.endsWith(t)))?n=!0:r.push(t)})),n&&r.forEach((e=>t.searchParams.delete(e))),n?t.toString():e}return n&&n[1]?n[1]:e};var Fr=(e=>(e.RO="RO",e))(Fr||{});const Vr=(e,t)=>e.src.localeCompare(t.src),qr=(e,t=1)=>{if(t>=15)return console.warn("Max split level exceed"),[];const r=((e,t)=>{const r=Math.ceil(e.length/t),n=[];for(let i=0;i8)return qr(e,t+1);n.push(o)}return n},Xr=e=>e?e.replace(/\n/g,"").replace(/ {2,}/g," ").trim():"",Gr=(e,t)=>{if(!e)return null;const r="next"===t.type?e.nextSibling:e.previousSibling;if((null==r?void 0:r.nodeType)===Node.TEXT_NODE){if(!Xr(r.nodeValue))return Gr(r,{type:t.type})}return r},Kr=e=>{const t=e.nodeType===Node.ELEMENT_NODE,r=e instanceof Element&&"hide"===e.getAttribute("data-uw-rm-heading");if(e.nodeType===Node.TEXT_NODE)return!0;if(t&&!r){const t=st.some((t=>t===e.nodeName.toLowerCase())),r=ut.some((t=>{var r;return t===(null==(r=e.getAttribute("role"))?void 0:r.toLowerCase())}));return t||r}return!1},zr=Array.from(new Set([...st,"a","span","strong","em","b","i","q","mark"])),Zr=e=>{if((null==e?void 0:e.nodeType)===Node.TEXT_NODE){const t=Xr(e.nodeValue);if(t&&!Tr(t))return t}if((null==e?void 0:e.nodeType)===Node.ELEMENT_NODE&&zr.includes(e.tagName.toLowerCase()))for(const t of e.childNodes){const e=Zr(t);if(e)return e}return null},Yr=e=>{const t=e.nodeType===Node.ELEMENT_NODE,r=e.nodeType===Node.TEXT_NODE;if(!r&&!t)return!1;if(t&&"img"===e.nodeName.toLowerCase())return!0;if(r)return!!Xr(e.textContent);const n=st.some((t=>t===e.nodeName.toLowerCase())),i=ut.some((t=>{var r;return t===(null==(r=e.getAttribute("role"))?void 0:r.toLowerCase())}));return n||i};let Qr=0;const Jr=e=>{const t=e.parentElement;if(!t)return null;if(t.getElementsByTagName("img").length>1)return Qr=0,null;if(1===[].slice.call(t.childNodes).filter(Yr).length)return Jr(t);const r=(e=>{let t=Gr(e,{type:"next"}),r=Gr(e,{type:"prev"}),n=null,i=null;for(;t||r;){t&&Kr(t)&&(n=Zr(t)),r&&Kr(r)&&(i=Zr(r));const e=n||i;if(e)return e;t=Gr(t,{type:"next"}),r=Gr(r,{type:"prev"})}return null})(e);return r?(Qr=0,r):(Qr+=1,"body"===t.tagName.toLowerCase()?(Qr=0,null):Qr<2?Jr(t):(Qr=0,null))},en=e=>{const t=e.closest("figure");if(t){const e=Array.from(t.children).find((e=>"figcaption"===e.tagName.toLowerCase()));if(e){const t=Xr(e.textContent);if(t&&!Tr(t))return t}}const r=[].slice.call(e.classList).join(" "),n=e.id||"",i=(o=r+n).trim()&<.find((e=>o.includes(e)))||null;var o;if(i)return i;const a=Jr(e);return a||null},tn=(e,t)=>{if(!Or(e))return!1;const r=hr(e);return vr(r)!==t&&!Ar(e,20)},rn=(e,t,r)=>{e.addEventListener("load",(()=>{t()})),e.addEventListener("error",(()=>{Er(e),e.setAttribute(gt,At.NotLoaded),r()}))},nn=e=>(t,r)=>{if(Sr(e.src))return Er(e),e.setAttribute(gt,At.Excluded),void r(e);if((e=>e.complete&&0!==e.naturalHeight)(e))return void t(e);if("lazy"===e.loading)return void rn(e,(()=>t(e)),(()=>r(e)));const n=new Image;rn(n,(()=>t(e)),(()=>r(e))),n.src=e.src},on=[],an=(e,t)=>{if(!j)return;const{state:r}=j;if("ALTS_OFF"===r)return;const n=(e=>{var t,r;const n=[];for(const i of e){const e=hr(i),t=vr(e);if(t){let e=n.find((e=>e.name===t));e||(e={name:t,weight:0},n.push(e)),e.weight+=1}}return null!=(r=null==(t=n.sort(((e,t)=>e.weight{const t=e,r=t.filter(((e,r)=>r===t.findIndex((t=>hr(e)===hr(t))))).map((e=>{const t=e,r=t.alt.trim(),n=r&&!Tr(r),i=hr(t),o=Pr(t);return{src:$r(i),alt:t.alt.trim(),dir:n||Cr(t)||(null==o?void 0:o.relevantText)?Fr.RO:void 0}}));return r.sort(Vr),r})(i),r=qr(e);if(r.length)for(const n of r)Hr(n).then((e=>{if(t(),!e)return;const{missingAlts:r}=e,n=i.filter((e=>r.find((t=>A(t.src)===A(hr(e))))));Wr(n,r)}));Wr(o),on.length=0,r.length||t()}catch(a){console.error(a)}},ln=Ue(((e,t)=>an(e,t)),1e3,{maxWait:2e3,leading:!1,trailing:!0}),sn=Kt({ruleId:bt,rule:({context:{elements:e}})=>new Promise((t=>{e.reduce(((e,t)=>t.getAttribute("src")||t.getAttribute("srcset")?[...e,new Promise(nn(t))]:(Er(t),t.setAttribute(gt,At.InvalidSrc),e)),[]).forEach((e=>{e.then((e=>{on.push(e),ln(on,t)})).catch((()=>{}))}))})),isTargetElement:e=>{const t="img"===e.tagName.toLowerCase(),r=e.hasAttribute(gt);return!(!t||r)},postMessageApi:{"image-alt-update":({src:e,decorative:t,alt:r,role:n})=>{const i=jr(e);if(i.length){for(const e of i)e.setAttribute("alt",null!=r?r:""),t?Er(e):("presentation"!==e.getAttribute("role")&&"none"!==e.getAttribute("role")||e.removeAttribute("role"),e.hasAttribute("aria-hidden")&&e.removeAttribute("aria-hidden")),["link","button","heading"].includes(n)&&e.setAttribute("aria-label",r);Br([yr(i[0],{approved:!0,decorative:t,fixedByUserWay:!1})])}},"image-alt-revert":({src:e})=>{const t=jr(e);for(const r of t){const e=r.getAttribute(ft);null!==e&&r.setAttribute("alt",e)}}}}),un=e=>{const{tagName:t}=e;return"SELECT"===t||"TEXTAREA"===t?t.toLowerCase():"text"},cn=e=>{const t=e.getAttribute("id");if(!t)return null;try{return document.querySelector(`label[for='${t}']`)}catch(r){return null}},dn=e=>{const t="string"==typeof e?e:e.textContent;return t&&t.replace(/\r\n|\r|\n|\t/g," ").replace(/( )+/g," ").trim()},pn=(e,t)=>{for(const[r,n]of t)if(n.test(e))return r;return""},mn=e=>{let t="";const r=e.getAttribute("placeholder"),n=e.getAttribute("title");if(r&&r.trim())return r;if(n&&n.trim())return n;const{classList:i,name:o,tagName:a,type:l}=e,s=`${[...i].join(" ")||""} ${o||""}`.trim();return"text"===l&&(t=pn(s,Dt)),"SELECT"===a&&(t=pn(s,Pt)),t||(e=>{const{tagName:t,type:r}=e;return"SELECT"===t?"select-multiple"===r?"Multiple select":"Single select":"TEXTAREA"===t?"Text area":"INPUT"===t&&r&&Mt[r.replace("-","_")]?Mt[r.replace("-","_")]:""})(e)},fn=e=>{if(e.parentElement){const t=[...e.parentElement.querySelectorAll("label")];if(1===t.length&&(e=>{const t="LABEL"===e.tagName,r=e.getAttribute("for");return t&&(!(null==r?void 0:r.trim())||!document.getElementById(r))})(t[0]))return t[0].textContent}return null},bn=e=>{const t=e.previousElementSibling;return t&&(e=>{var t;return["DIV","SPAN","P"].includes(e.tagName)&&Boolean(null==(t=e.textContent)?void 0:t.trim())})(t)?(B.strategy===je&&((e,t)=>{const r=t.getAttribute("id")||p();t.setAttribute("id",r),e.setAttribute("aria-labelledby",r)})(e,t),t.textContent):null},gn=(e,t,r,n=!0)=>{if(!n)return;const i=e.closest("label"),o=cn(e);r?(e.setAttribute("required",""),e.setAttribute("aria-required","true")):(e.removeAttribute("required"),e.removeAttribute("aria-required"));const a=i||o;if(a){const e=a.querySelector("span[data-uw-reader-element]");if(e)e.textContent=t;else{const e=((e,t="")=>{const r=document.createElement("span");return r.textContent=e,r.style="color: #ffffff!important;background: #000000!important;clip: rect(1px, 1px, 1px, 1px)!important;clip-path: inset(50%)!important;height: 1px!important;width: 1px!important;margin: -1px!important;overflow: hidden!important;padding: 0!important;position: absolute!important;",r.setAttribute("class",t),r.setAttribute("data-uw-reader-element",""),r.setAttribute("data-uw-rm-ignore",""),r})(t);a.appendChild(e)}}else e.hasAttribute("aria-labelledby")||e.setAttribute("aria-label",t)},hn=e=>{const t=e.getAttribute("aria-labelledby");if(t){const e=(e=>{var t;const r=e.split(" "),n=[];for(const i of r){const e=null==(t=document.getElementById(i))?void 0:t.textContent;e&&n.push(e)}return n.join(" ")})(t);if(e){const t=dn(e);if(t)return t}}const r=e.getAttribute("aria-label");if(r){const e=dn(r);if(e)return e}const n=e.closest("label");if(n){const e=(e=>{let t=e.textContent||"";const r=e.querySelector("select");if(r){const e=r.textContent||"";t=t.replace(e,"")}return t.trim()})(n);if(e)return dn(e)}const i=cn(e);if(i){const e=dn(i);if(e)return e}return null},An=(e,t,r,n)=>{const{Forms:i}=q(),o=hn(e),a=i.find((({xpath:e,approved:t})=>t&&+e===m(r)));return o&&(e=>{const t=cn(e);if(!t)return!1;const{display:r,visibility:n}=getComputedStyle(t);return"none"===r||"hidden"===n})(e)&&e.setAttribute("aria-label",o),a?(gn(e,a.correction,a.required,!0),{type:a.type,xpath:r,required:a.required,correction:a.correction,approved:a.approved,xpathHash:m(r),label:o}):o?(e.setAttribute(Ot,"nfx"),{type:t,xpath:r,correction:o,approved:!0,xpathHash:m(r),label:o,required:n}):null},yn=e=>{((e,r={})=>{var n,i;const o={skipParentCheck:null!=(n=r.skipParentCheck)&&n,shouldBeInViewport:null==(i=r.shouldBeInViewport)||i};let a=e,l=t(a,o);if(!o.skipParentCheck)for(;l&&a.parentNode&&a.parentNode!==document;)t(a.parentNode,{shouldBeInViewport:!1})?a=a.parentNode:l=!1;return l})(e,{shouldBeInViewport:!1})||(e.setAttribute("aria-label",kt),e.setAttribute(Rt,kt),((e,t)=>{new IntersectionObserver(((r,n)=>{for(const i of r)i.intersectionRatio>0&&(t(e),n.disconnect())})).observe(e)})(e,(()=>{e.hasAttribute(Rt)&&e.hasAttribute("aria-label")&&e.getAttribute(Rt)===e.getAttribute("aria-label")&&(e.removeAttribute(Rt),e.removeAttribute("aria-label"))})));const r=fn(e);if(r)return r;const n=bn(e);if(n)return n;const i=mn(e);return i||null},En=Kt({ruleId:St,rule:({context:{elements:e}})=>{const t=[];for(const r of e){r.setAttribute(Ot,"fx");const e=r.hasAttribute("required"),n=B.strategy===je,i=f(r),o=un(r),a=An(r,o,i,e);if(a){t.push(a);continue}const l=yn(r);l?(gn(r,l,e,n),t.push({type:o,xpath:i,correction:l,approved:!1,xpathHash:m(i),label:null,required:e})):t.push({type:o,xpath:i,correction:null,approved:!1,xpathHash:m(i),label:null,required:e})}kr(St,t,t.filter((e=>e.approved)).length,t.filter((e=>!e.approved)).length)},isTargetElement:e=>{const t=Ct.includes(e.tagName);if(e.hasAttribute(Ot)||!t)return!1;const r=e.getAttribute("type");return!("SELECT"!==e.tagName&&"TEXTAREA"!==e.tagName&&("INPUT"!==e.tagName||"hidden"===r))},postMessageApi:{"form-label-update":({correction:e,required:t,xpath:r})=>{const n=x(r.toString());n&&(e&&(n.setAttribute("aria-label",e),n.removeAttribute("aria-labelledby")),t?(n.setAttribute("required",""),n.setAttribute("aria-required","true")):(n.removeAttribute("required"),n.removeAttribute("aria-required")))}}}),vn=e=>{const t=e.tagName.toLowerCase(),r=null==e?void 0:e.type,n=e.getAttribute("role");return["a","button"].includes(t)?"a"===t?"":"